-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ResponseOps][Alerts] Move the alerts table to a dedicated package #207878
base: main
Are you sure you want to change the base?
Conversation
99c6d4d
to
72b83e5
Compare
72b83e5
to
002f502
Compare
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObsUx Infra and Services changes LGTM
packages/response-ops/alerts_table/components/alerts_data_grid.tsx
Outdated
Show resolved
Hide resolved
5459a7d
to
4df554f
Compare
4df554f
to
1428348
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ResponseOps team collectively approves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed the Rule Management table owned code and tested the changes on the Rule Details page. I approved on behalf of the Rule Management.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested alerts table in security, o11y and stack management and cases alerts tab. works as expected 👍
5016bcc
to
254d5fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @umbopepato for this refactor.
I have requested some very small changes regarding virtualization. Additionally, could I please ask you to create an issue to remove the workaround we added in this PR : #208052
@@ -21,7 +21,7 @@ export type CellValueElementProps = EuiDataGridCellValueElementProps & { | |||
browserFields?: BrowserFields; | |||
data: TimelineNonEcsData[]; | |||
ecsData?: Ecs; | |||
eventId: string; // _id | |||
eventId?: string; // _id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@umbopepato , Could you please elaborate in what case eventId
will be undefined
?
initialPageSize={50} | ||
runtimeMappings={sourcererDataView?.runtimeFieldMap as RunTimeMappings} | ||
toolbarVisibility={toolbarVisibility} | ||
dynamicRowHeight={isEventRenderedView} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement disables the virtualization in Event Rendered View
. We fixed this here: https://github.com/elastic/kibana/pull/192827/files#diff-55d89a9f7cd09ba80ef7752e07f2f65922b66e417052cb583f18f741f47608e4L293
This results in degraded performance
- when user switches from
Grid View
toEvent Rendered View
as shown below. - Any subsequent re-renders
This Branch
Screen.Recording.2025-02-05.at.12.33.06.mov
Main ( 9.0 )
Screen.Recording.2025-02-05.at.12.34.28.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! I must have missed it while rebasing the feature branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.. It is a big effort and huge list of changes. Can happen. Thanks for taking care of this.
} | ||
cellActionsOptions={cellActionsOptions} | ||
showInspectButton | ||
services={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please memoize all the non-primitive objects before passing to the components. This will otherwise result in unneeded renders because each time new instance of that object will be created.
Even if the object is memoized
lower in the tree, it would not help since the identity of the object will anyways change at this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
tabType={'query'} | ||
tableId={tableType} | ||
width={0} | ||
setEventsLoading={({ isLoading }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should move this to a useCallback, setEventsDeleted as well, or as a reference outside of the render
} = useSelector((state: State) => eventsViewerSelector(state, tableType)); | ||
const eventContext = useContext(StatefulEventContext); | ||
|
||
const timelineItem: TimelineItem = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should memoize this as it's creating a new object
const casesConfiguration = { featureId: CASES_FEATURE_ID, owner: [APP_ID], syncAlerts: true }; | ||
const emptyInputFilters: Filter[] = []; | ||
|
||
export const AlertsTableComponent: FC<Omit<DetectionEngineAlertTableProps, 'services'>> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should wrap this in a memo
- Removes the alerts table registry in favor of a props-only configuration - Converts all the usages of the alerts table to use only props - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Christos Nasikas <[email protected]>
Moves the alerts table code and dependencies to dedicated packages in `packages/response-ops/**`. > [!IMPORTANT] > 🚧 Merging to the `alerts-table-refactor` feature branch` - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Christos Nasikas <[email protected]>
…tCases (#207038) ## Summary > [!IMPORTANT] > 🚧 Merging to the `alerts-table-refactor` feature branch, no review needed from teams other than `response-ops` > [!WARNING] > Some tests are intentionally left failing since the converted usages of the alerts table still have to be validated/improved by solutions and may change significantly Adds a `renderAlertsTable` prop to `getCases` to allow solutions to customize the alerts table shown in the `Alerts` tab of their case view.
## Summary The Security Solution alerts table CellValue component was receiving some wrong props when used in the Rule preview table. This PR removes the spread `{...props}` expression and type cast that didn't catch this error and correctly converts props and types.
…om security flyout (#208052) ## Summary Fixes the toggleColumn functionality not working from the Security Solution flyout. Uses a global context to share a reference to the `toggleColumn` function as a **temporary solution** until the handling of the columns inside the alerts table is refactored to correctly receive updates from the outside.
254d5fa
to
b11c7b9
Compare
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
miscellaneous assets size
References to deprecated APIs
Total ESLint disabled count
History
|
Summary
This PR turns the AlertsTable into a standalone component, making it independent from the
TriggersActionsUI
plugin.Removes the alerts table registry
All configuration is now managed through the AlertsTable component props. Shared configurations are handled by giving consumers the ability to directly provide alerts table wrapper components (see for example the
renderAlertsTable
prop ofgetCases
).Moves the alerts table to dedicated package(s)
Following the feature-driven structure we're introducing for ResponseOps (alerting) client-side packages:
@kbn/response-ops-alerts-table
@kbn/response-ops-alerts-apis
@kbn/response-ops-alerts-fields-browser
Initial work on improving composition and organization
components/
,hooks/
, ...)To verify
For consumers of the alerts table:
Warning
This PR moves a lot of files. Git might not always recognize the correct delete/add file pairs. If you see weird diffs feel free to reach out for help!
Checklist
Identify risks
References
Closes #195180